class Tool:
    count = 0
    def __init__(self,name):
        self.name=name
        Tool.count+=1
    #定义一个类方法
    @classmethod
    def show_tool_count(cls):
        print(cls.count)

aa=Tool(name='扳手')
print(aa.count)
bb=Tool(name='砍刀')
print(bb.count)
cc=Tool(name='尖头手稿')
print(cc.count)


Tool.show_tool_count()